﻿<%@ Page Language="C#" AutoEventWireup="true" Title="Caja" MasterPageFile="~/MasterPage.master" CodeFile="Caja.aspx.cs" Inherits="Admin_Caja"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="content" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 
    <asp:ScriptManager id="ScriptManager1" runat="server"></asp:ScriptManager>
    &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
    <table width="100%">
        <tr>
            <td class="tdCajas" colspan="4" style="width: 100%; height: 18px">
                Caja &nbsp;<asp:Label ID="lblCaja" runat="server" Text="Label"></asp:Label></td>
        </tr>
        <tr>
            <td class="tdForm" colspan="4" style="width: 100%; text-align: center">
                <asp:Label ID="lblAccion" runat="server" CssClass="lblAccion" Text="lblAccion"></asp:Label>
            </td>
        </tr>
        <tr id="trConcepto1" runat="server">
            <td class="tdForm" style="width: 25%; text-align: right; height: 23px;">
                <asp:Label ID="lblConcepto" runat="server" Text="Concepto:"></asp:Label>
            </td>
            <td align="left" class="tdForm" style="width: 20%; text-align: left; height: 23px;">
                <asp:TextBox ID="txtIdConcepto" runat="server" AutoPostBack="True" OnTextChanged="txtIdConcepto_TextChanged"
                    Width="75px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvConcepto" runat="server" ControlToValidate="txtIdConcepto"
                    ErrorMessage="(*)" ValidationGroup="Agregar"></asp:RequiredFieldValidator>
            </td>
            <td class="tdForm" colspan="2" style="width: 55%; text-align: left; height: 23px;">
                <asp:Button ID="boton" runat="server" OnClick="btnBuscarConcepto_Click" Text="..." />
                <asp:TextBox ID="txtConcepto" runat="server" Width="85%"></asp:TextBox>&nbsp;</td>
        </tr>
        <tr id="trConcepto2" runat="server">
            <td class="tdForm" style="width: 25%; text-align: right">
                <asp:Label ID="lblMonto" runat="server" Text="Monto $:"></asp:Label></td>
            <td align="left" class="tdForm" style="width: 20%; text-align: left">
                <asp:TextBox ID="txtMonto" runat="server" MaxLength="10" Width="75px"></asp:TextBox>
                <asp:RangeValidator ID="rvMonto" runat="server" ControlToValidate="txtMonto" ErrorMessage="(*)"
                    MaximumValue="9999999.99" MinimumValue="0.00" Type="Double"></asp:RangeValidator></td>
            <td class="tdForm" colspan="2" style="width: 55%; text-align: left">
                <asp:RadioButton ID="rdbEgresos" runat="server" AutoPostBack="True" CausesValidation="True"
                    Checked="True" OnCheckedChanged="rdbEgresos_CheckedChanged" Text="Egresos" ValidationGroup="vgConceptos" />
                &nbsp; &nbsp;<asp:RadioButton ID="rdbIngresos" runat="server" AutoPostBack="True"
                    CausesValidation="True" OnCheckedChanged="rdbIngresos_CheckedChanged" Text="Ingresos"
                    ValidationGroup="vgConceptos" />&nbsp;<asp:CheckBox ID="chkDetalle" runat="server"
                        Text="Detalle" /></td>
        </tr>
        <tr id="trCCostos" runat="server">
            <td class="tdForm" style="width: 25%; text-align: right">
                Centro de Costos:</td>
            <td align="left" class="tdForm" colspan="3" style="width: 75%; text-align: left">
                <asp:DropDownList ID="cboCCostos" runat="server" Width="95%">
                </asp:DropDownList></td>
        </tr>
        <tr id="trConcepto3" runat="server">
            <td class="tdForm" style="width: 25%; text-align: right">
                <asp:Label ID="lblObservaciones" runat="server" Text="Observaciones:"></asp:Label>
            </td>
            <td align="left" class="tdForm" colspan="3" style="width: 75%; text-align: left">
                <asp:TextBox ID="txtObservaciones" runat="server" Width="95%"></asp:TextBox>
            </td>
        </tr>
        <tr id="trConcepto4" runat="server">
            <td align="center" class="tdForm" colspan="4" style="width: 100%; text-align: center">
                <asp:Button ID="btnAgregar" runat="server" OnClick="btnAgregar_Click" Text="Agregar"
                    ValidationGroup="Agregar" Width="75px" /></td>
        </tr>
        <tr>
            <td align="center" class="tdForm" colspan="4" style="width: 100%; text-align: center">
                <asp:GridView ID="gvCaja" runat="server" AutoGenerateColumns="False" CellPadding="4"
                    ForeColor="#333333" GridLines="Vertical" OnPageIndexChanging="gvCaja_PageIndexChanging"
                    OnRowCancelingEdit="gvCaja_RowCancelingEdit" OnRowDataBound="gvCaja_RowDataBound"
                    OnRowDeleting="gvCaja_RowDeleting" OnRowEditing="gvCaja_RowEditing" OnRowUpdating="gvCaja_RowUpdating"
                    Width="100%">
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                    <Columns>
                        <asp:TemplateField HeaderText="N&#250;mero">
                            <ItemTemplate>
                                <asp:Label ID="lIdConcepto" runat="server" Text='<%# Bind("Id_Item") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle ForeColor="White" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Operaci&#243;n">
                            <ItemTemplate>
                                <asp:Label ID="lOperacion" runat="server" Text='<%# Bind("Tipo") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle ForeColor="White" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Concepto">
                            <ItemTemplate>
                                <asp:Label ID="lConcepto" runat="server" Text='<%# Bind("Concepto") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle ForeColor="White" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Monto">
                            <EditItemTemplate>
                                <asp:TextBox ID="tMonto" runat="server" Text='<%# Bind("Monto", "{0:F2}")  %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lMonto" runat="server" Text='<%# Bind("Monto", "{0:F2}") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle ForeColor="White" />
                        </asp:TemplateField>
                        <asp:CommandField EditText="Modificar" ShowEditButton="True">
                            <ItemStyle ForeColor="Blue" />
                        </asp:CommandField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkEliminar" runat="server" CausesValidation="False" CommandName="Delete"
                                    OnClientClick="return confirm('¿Seguro que desea eliminar este registro?');"
                                    Text="Eliminar"></asp:LinkButton>
                            </ItemTemplate>
                            <HeaderStyle ForeColor="White" />
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#325FB9" Font-Bold="True" Font-Names="Arial Rounded MT Bold"
                        ForeColor="White" />
                    <AlternatingRowStyle BackColor="Gainsboro" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td align="center" class="tdForm" colspan="3" style="height: 22px; text-align: right">
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<asp:Label ID="Label1" runat="server" Text="Total $:"></asp:Label></td>
            <td class="tdForm" style="width: 25%; height: 22px; text-align: left">
                &nbsp;<asp:TextBox ID="txtTotal" runat="server" CssClass="numero" ReadOnly="True"
                    Width="75px"></asp:TextBox></td>
        </tr>
    </table>
    &nbsp;
    &nbsp;&nbsp;
    <table class="tdForm" style="width: 100%">
        <tr>
            <td style="width: 100%" class="tdBotones">
                <asp:Button ID="btnCancelar" runat="server" OnClick="btnCancelar_Click" Text="Cancelar" />
                &nbsp;
                <asp:Button ID="btnCerrarCaja" runat="server" OnClick="btnCerrarCaja_Click" Text="Inventario Caja" /></td>
        </tr>
    </table>
        <asp:Panel ID="pnlTarifaInvalida" runat="server" CssClass="tdBotones" Style="display: none" Width="233px">
        <div style="text-align:center; background-image: none; background-color: transparent;">
            No puede agregar un Concepto sin Monto<br />
            <br />
            <asp:Button ID="btnOkTarifaInvalida" runat="server" Text="OK" Width="64px"/>
        </div>
    </asp:Panel>
       <table border="0" id = "OcultarProveedor" runat="server" style="width: 0px; height: 0px">
            <tr>
                <td style="width: 100px; height: 18px;">
                    <asp:Button ID="btnTarifaInvalidaInvisible" runat="server" Text="Button" Height="0px" Width="0px" />
                </td>
            </tr>
        </table>
    <cc1:ModalPopupExtender id="mpeMonto" runat="server" backgroundcssclass="modalBackground"
        dropshadow="true" okcontrolid="btnOkTarifaInvalida" popupcontrolid="pnlTarifaInvalida" targetcontrolid="btnTarifaInvalidaInvisible">
    </cc1:ModalPopupExtender>            
</asp:Content>
